package com.dao.cook.imp;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.dao.cook.CtodaymenuDaoY;
import com.po.TodaymenuY;
import com.po.TomorrowmenuY;

@Repository
public class CtodaymenuDaoImpY implements CtodaymenuDaoY{
	
	@Resource(name = "sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	
	@Override
	public List<TodaymenuY> getTodayMenuList() {
		List<TodaymenuY> list=sqlSessionTemplate.selectList("getTodayMenuListY");
		return list;
	}

	@Override
	public int addTodayMenus(List<TomorrowmenuY> menu) {
		int i=sqlSessionTemplate.insert("addTodayMenusY", menu);
		return i;
	}

	@Override
	public int delTodayMenu() {
		int i=sqlSessionTemplate.delete("delTodayMenuY");
		return i;
	}

	@Override
	public TodaymenuY getTodaymenu(String id) {
		TodaymenuY todaymenu=sqlSessionTemplate.selectOne("getTodaymenuY", id);
		return todaymenu;
	}
}
